<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		
		<meta charset="utf-8" />
		<title></title>
		
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		
		<link rel="stylesheet" href="static/css/datepicker.css" /><!-- 日期框 -->
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		
<script type="text/javascript">

	$(top.hangge());
	//保存
	function save(){
		if($("#auditstatevalue").val()=="3"&&$("#auditStateDesc").val()==""){
			$("#auditStateDesc").tips({
				side:3,
	            msg:'输入未通过原因',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#auditStateDesc").focus();
			return false;
		}
		else{
			$("#userForm").submit();
			$("#zhongxin").hide();
			$("#zhongxin2").show();
		}
	}
	 function show_sub(v){
		 if(v!=null){
			 $("#auditstatevalue").attr("value",v);
			 $(".stateDesc").css('display','none');
		 }
	        if(v!=null&&v==3){
	        	$(".stateDesc").css('display','block');
	        	$("#auditstatevalue").attr("value",v);
	        }   
	    }  
	 
</script>
	</head>
<body>
	<form action="appuser/${msg }.do" name="userForm" id="userForm" method="post">
	<!-- id -->
	
	<input type="hidden" name="auditstatevalue" id="auditstatevalue" value="">
	
	<c:choose>
		<c:when test="${not empty project}">
				<c:forEach items="${project}" var="project" varStatus="vs">
						<input type="hidden" name="id" id="id" value="${project.id}"/>	
				</c:forEach>
		 </c:when>
					 
	 </c:choose>
		<div id="zhongxin" style="margin:20px">
		<table  align="center" >
			<tr class="info">
				<td>
				<select name="auditstatevalue" id="auditstatevalue" data-placeholder="请选择进度" style="vertical-align:top;"  title="级别" onchange="show_sub(this.options[this.options.selectedIndex].value)">
					<c:forEach items="${statelist}" var="role">
						<option value="${role.value }"  id="selectId" >${role.desc }</option>
					</c:forEach>
				</select>
				</td>
			</tr>
			<tr class="stateDesc" style="display:none">
				<td>
					<input type="text" name="auditStateDesc" id="auditStateDesc" value="${record.record_desc }" placeholder="审批未通过原因" title="审批未通过原因"/>
				</td>
			</tr>
			
			<tr>
			    <td><center><span style="color:#F00">更改项目状态会实时通知到用户</span></center></td>
			</tr>
			
			<tr>
				<td class="center" colspan="2">
					<a class="btn btn-mini btn-primary" onclick="save();">保存</a>
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
		</table>
		</div>
		
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
		
	</form>
	
	
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		<script type="text/javascript"></script>
	
</body>
</html>